package com.fdb.efp.nls.service.impl;

import com.fdb.basic.framework.core.base.FrameworkService;
import com.fdb.efp.nls.service.dao.AccLedgerDownloadFileTempDao;
import com.fdb.efp.nls.service.domain.AccLedgerDownloadFileTemp;
import com.fdb.efp.nls.service.facade.AccLedgerDownloadFileTempService;
import com.fdb.efp.nls.service.vo.AccLedgerDownloadFileTempVO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("accLedgerDownloadFileTempService")
public class AccLedgerDownloadFileTempServiceImpl implements AccLedgerDownloadFileTempService,FrameworkService{
	private static Logger logger = LoggerFactory.getLogger(AccLedgerDownloadFileTempServiceImpl.class);
	@Autowired
	private AccLedgerDownloadFileTempDao accLedgerDownloadFileTempDao;
	@Override
	public int insert(AccLedgerDownloadFileTempVO record) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int insertSelective(AccLedgerDownloadFileTempVO record) {
		// TODO Auto-generated method stub
		return 0;
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<AccLedgerDownloadFileTempVO> getAccLedgerDownloadFileTempList() {
		logger.debug("当前查询数据信息的参数信息为:");
		List<AccLedgerDownloadFileTempVO> list = null;
		try {
			List<AccLedgerDownloadFileTemp> accLedgerFileTemps = accLedgerDownloadFileTempDao.getAccLedgerDownloadFileTempList();
			logger.debug("当前查询数据信息的结果集数量为:" + accLedgerFileTemps.size());			
			list = (List<AccLedgerDownloadFileTempVO>) beansCopy(accLedgerFileTemps, AccLedgerDownloadFileTempVO.class);
		} catch (Exception e) {
			logger.error("数据转换出现异常!", e);
		}

		return list;
	}

	@Override
	public int update(String changeDate) {
		logger.debug("当前修改数据为参数为:" +changeDate);
		int num = 0;
		try {			
			num = accLedgerDownloadFileTempDao.update(changeDate);
		} catch (Exception e) {
			logger.error("修改数据发生异常!", e);
			num = -1;
		}
		logger.debug("修改为:" + changeDate + "修改的数据条数为" + num);
		return num;
	}

	 /**
     * 
     * 设置马上并账信息模板表交易金额、渠道日期为空 <br>
     * 0.1:ludayong:2019年7月4日 下午3:42:29:新增 <br>
     * @author ludayong
     * @since 2019年7月4日 下午3:42:29
     * @date 2019年7月4日 下午3:42:29
     * @version 0.1
     */
	@Override
	public int updateAmountAndChannelDate2Null() {
		logger.debug("设置马上并账信息模板表交易金额、渠道日期为空开始");
		int num = 0;
		try {			
			num = accLedgerDownloadFileTempDao.updateAmountAndChannelDate2Null();
		} catch (Exception e) {
			logger.error("修改数据发生异常!", e);
			num = -1;
		}
		logger.debug("设置马上并账信息模板表交易金额、渠道日期为空，修改的数据条数为" + num);
		return num;
	}
}
